{% extends 'base.html' %}

{% block title %}
    部门列表
{% endblock %}

{% block css %}
    <style>
        .navbar {
            border-radius: 0;
        }
    </style>
{% endblock %}

{% block content %}


    <div class="container">
        <div style="margin-bottom: 10px">
            <a href="/d2/depart/add/" class="btn btn-success">
                <span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
                新增部门
            </a>
        </div>
        <div class="bs-example" data-example-id="bordered-table">
            <table class="table table-bordered">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>名称</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                {% for depart in departs %}
                    <tr>
                        <td>{{ depart.id }}</td>
                        <td>{{ depart.title }}</td>
                        <td>
                            <a href="/d2/depart/{{ depart.id }}/edit/" class="btn btn-primary btn-xs">编辑</a>
                            <a href="/d2/depart/delete/?nid={{ depart.id }}" class="btn btn-danger btn-xs">删除</a>
                        </td>
                    </tr>
                {% endfor %}

                </tbody>
            </table>
        </div>

        <ul class="pagination">
            {{ page_str }}
        </ul>
    </div>

{% endblock %}